package com.hy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hy.medicine.evaluation.pojo.SensitiveWord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 敏感词
 */
@Mapper
public interface SensitiveWordMapper extends BaseMapper<SensitiveWord> {

    @Select("SELECT word FROM sensitive_word WHERE level = #{level}")
    List<String> selectWordsByLevel(@Param("level") Integer level);

    @Select("SELECT * FROM sensitive_word ORDER BY level DESC, word ASC")
    List<SensitiveWord> selectAllWords();
}
